<template>
    <div>
        <h1>显示</h1>
        标题<input type="text" v-model="info.names">
        类型<select v-model="info.lx">
            <option value="">请选择</option>
            <option value="服务协议">服务协议</option>
            <option value="修车">修车</option>
            <option value="宠物">宠物</option>
        </select>
        <input type="button" value="查询" @click="getlist">
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>Id</td>
                    <td>标题</td>
                    <td>公告内容</td>
                    <td>公告照片</td>
                    <td>状态</td>
                    <td>类型</td>
                </tr>
                <tr v-for="itme in data.list" :key="itme.Id">
                    <td>{{ itme.Id }}</td>
                    <td>{{ itme.Name }}</td>
                    <td>{{ itme.NeiRong }}</td>
                    <td><img :src="itme.Img" width="100" height="100"></td>
                    <td>{{ itme.State == true ? "启用" : "禁用" }}</td>
                    <td>{{ itme.LX }}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import axios from 'axios';
import { useRouter } from 'vue-router';
const rouder = useRouter();
let info: any = reactive({
    names: '',
    lx: ''

})
let data: any = reactive({
    list: []
})
onMounted(() => {
    getlist();
})
const getlist = () => {
    axios({
        url: '/api/GongGao/GetShow',
        method: 'get',
        params: info
    })
        .then((res) => {
            console.log(res);
            data.list = res.data

        })
        .catch((err) => {
            console.log(err);

        })
}
</script>


<style scoped></style>